Make the code work as intended for unthemed icons; don't scale them up too
authorMatthias Clasen <mclasen@redhat.com>
Tue, 5 Oct 2004 03:18:22 +0000 (03:18 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 5 Oct 2004 03:18:22 +0000 (03:18 +0000)
2004-10-04  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkicontheme.c (icon_info_ensure_scale_and_pixbuf):
Make the code work as intended for unthemed icons; don't scale
them up too much. Allow to scale them down, and do so
exactly.  (#154142, Ross Burton)
(gtk_icon_info_load_icon): Amend docs.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkicontheme.c

index cc8d2ca72191c96efc99549dfaee352b61514899..bb465d1aea73cadf77e92ae72786996fa30a2e27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2004-10-04  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (icon_info_ensure_scale_and_pixbuf): 
+       Make the code work as intended for unthemed icons; don't scale
+       them up too much. Allow to scale them down, and do so 
+       exactly.  (#154142, Ross Burton)
+       (gtk_icon_info_load_icon): Amend docs.
+
        * gtk/gtkcelllayout.c (gtk_cell_layout_clear): Improve 
        docs.  (#154504, Dave Cook)
 
index cc8d2ca72191c96efc99549dfaee352b61514899..bb465d1aea73cadf77e92ae72786996fa30a2e27 100644 (file)
@@ -1,5 +1,11 @@
 2004-10-04  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (icon_info_ensure_scale_and_pixbuf): 
+       Make the code work as intended for unthemed icons; don't scale
+       them up too much. Allow to scale them down, and do so 
+       exactly.  (#154142, Ross Burton)
+       (gtk_icon_info_load_icon): Amend docs.
+
        * gtk/gtkcelllayout.c (gtk_cell_layout_clear): Improve 
        docs.  (#154504, Dave Cook)
 
index cc8d2ca72191c96efc99549dfaee352b61514899..bb465d1aea73cadf77e92ae72786996fa30a2e27 100644 (file)
@@ -1,5 +1,11 @@
 2004-10-04  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (icon_info_ensure_scale_and_pixbuf): 
+       Make the code work as intended for unthemed icons; don't scale
+       them up too much. Allow to scale them down, and do so 
+       exactly.  (#154142, Ross Burton)
+       (gtk_icon_info_load_icon): Amend docs.
+
        * gtk/gtkcelllayout.c (gtk_cell_layout_clear): Improve 
        docs.  (#154504, Dave Cook)
 
index cc8d2ca72191c96efc99549dfaee352b61514899..bb465d1aea73cadf77e92ae72786996fa30a2e27 100644 (file)
@@ -1,5 +1,11 @@
 2004-10-04  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c (icon_info_ensure_scale_and_pixbuf): 
+       Make the code work as intended for unthemed icons; don't scale
+       them up too much. Allow to scale them down, and do so 
+       exactly.  (#154142, Ross Burton)
+       (gtk_icon_info_load_icon): Amend docs.
+
        * gtk/gtkcelllayout.c (gtk_cell_layout_clear): Improve 
        docs.  (#154504, Dave Cook)
 
index d46b1202a66ef16d88a508860c2fa94a21b96e7c..f4be0e403e98cc6a78798646caca440d76b12c73 100644 (file)
@@ -2321,12 +2321,12 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info,
     {
       gint image_size = MAX (image_width, image_height);
       if (image_size > 0)
-       icon_info->scale = icon_info->desired_size / image_size;
+       icon_info->scale = icon_info->desired_size / (gdouble)image_size;
       else
        icon_info->scale = 1.0;
       
       if (icon_info->dir_type == ICON_THEME_DIR_UNTHEMED)
-       icon_info->scale = MAX (icon_info->scale, 1.0);
+       icon_info->scale = MIN (icon_info->scale, 1.5);
     }
 
   /* We don't short-circuit out here for scale_only, since, now
@@ -2362,7 +2362,8 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info,
  * pixbuf may not be exactly this size; an icon theme may have icons
  * that differ slightly from their nominal sizes, and in addition GTK+
  * will avoid scaling icons that it considers sufficiently close to the
- * requested size. (This maintains sharpness.)
+ * requested size or for which the source image would have to be scaled
+ * up too far. (This maintains sharpness.) 
  * 
  * Return value: the rendered icon; this may be a newly created icon
  *  or a new reference to an internal icon, so you must not modify